/* 
 * File:   ImageDilatator.cpp
 * Author: Guilherme Monteiro
 * 
 */

#include "../headers/ImageDilatator.h"

ImageDilatator::ImageDilatator(IplImage* img) {
    this->image = img;
}

ImageDilatator::ImageDilatator(const ImageDilatator& orig) {
}

ImageDilatator::~ImageDilatator() {
}

/**
 * Dilate the image to facilitates the detection of
 * vertical invisible lines.
 * 
 * @return image dilatated
 */
IplImage* ImageDilatator::dilate() {
    IplImage* dilatedImage = cvCloneImage(this->image);
    
    //NA TENTATIVA DE MELHORAR A CORRECAO DA ROTACAO: -------------------------
    //cvDilate(this->image, dilatedImage, cvCreateStructuringElementEx(11, 2, 5, 1, CV_SHAPE_ELLIPSE), 1);    
    //-------------------------------------------------------------------------
    
    cvDilate(this->image, dilatedImage, cvCreateStructuringElementEx(11, 2, 0, 0, CV_SHAPE_ELLIPSE), 2);
    return dilatedImage;
}
